package com.teamwork.module03.controller;

import com.teamwork.common.result.Result;
import com.teamwork.module03.service.MessageService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/msg")
public class MessageController {

    @Resource
    private MessageService messageService;

    @GetMapping("/{userid}")
    public Result getMsg(@PathVariable("userid") Integer userid){
        return messageService.getMsg(userid);
    }
    //确认消息
    @GetMapping("/read/{msgid}")
    public Result readMsg(@PathVariable("msgid")Integer msgid){
        return messageService.readMsg(msgid);
    }


}
